import { getHomeCategories, getHotChoiceness } from '../../services/modules/home'
import { defineStore } from 'pinia'
const useHomeStore = defineStore('home', {
  state: () => {
    return {
      tabbarIndex: 0,
      homeCategoryList: [],
      HotChoiceness: [],
    }
  },
  actions: {
    async getHomeCategory() {
      const res = await getHomeCategories()
      this.homeCategoryList = res.data
    },
    async getHotChoice(page, pageSize) {
      console.log(page, pageSize)

      const res = await getHotChoiceness(page)
      this.HotChoiceness.push(...res.data)
    },
  },
})
export default useHomeStore
